<template>
  <dw-page-warpper :flex="true">
    <div style="width: 280px; height: 100%; background-color: #fff; box-shadow: #fff">
      <dw-tree :getTreeUrl="getTreeUrl" :addTreeUrl="addTreeUrl" :editTreeUrl="editTreeUrl" :delTreeUrl="delTreeUrl" @currentChange="onCurrentChange"></dw-tree>
    </div>
    <div style="width: calc(100% - 285px); height: 100%; background-color: #fff; box-shadow: #fff">
      <dw-menu-group :menu-table-info="menuTableInfo" :menu-form-list="menuFormList">
        <template #list>
          <dw-table></dw-table>
        </template>
      </dw-menu-group>
    </div>
  </dw-page-warpper>
</template>
<script setup lang="ts">
import type { IMenuItem } from '@/types/menu-group';

import type Node from 'element-plus/es/components/tree/src/model/node.mjs';
import { ref } from 'vue';
defineOptions({
  name: 'BusinessModel',
});
const getTreeUrl: string = '/admin-api/modeling/business/domain/tree';
const addTreeUrl: string = '/admin-api/modeling/business/domain';
const editTreeUrl: string = '/admin-api/modeling/business/domain';
const delTreeUrl: string = '/admin-api/modeling/business/domain/{id}';

const menuTableInfo = ref<IMenuItem>({ id: 'list', menuItemName: '业务模型' });
const menuFormList = ref<IMenuItem[]>([]);
const onCurrentChange = (node: Node, data: unknown) => {
  console.log(data);
};
</script>
